package cn.com.mall.search.controller;

import cn.com.mall.search.service.SearchService;
import cn.com.mall.search.vo.SearchParam;
import cn.com.mall.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Controller
public class SearchController {

    @Autowired
    SearchService searchService;

    @GetMapping("/list.html")
    public String list(SearchParam searchParam,Model model) {
        SearchResult result = searchService.search(searchParam);

        model.addAttribute("result",result);
        return "list";
    }



}
